import { SysDepartment } from '@/model/department/department';
import Http from '../http';

//获取公司下部门
export const getCorporationDepartmentList = async function (params?: { corporationKey?: string }) {
   return await Http.get('/api/SysDepartment/GetCorporationDepartmentList', params);
}

//获取所有公司及部门--登录公司为星辰公司，可以获取全部，否则只获取登录公司数据
export const getAllCorporationDepartmentList = async function (params?: { corporationKey?: string }) {
   return await Http.get('/api/SysDepartment/GetAllCorporationDepartmentList', params);
}


//获取公司部门下人员
export const getDepartmentUserList = async function (params?: { id?: string,corporationKey?: string }) {
   return await Http.get('/api/SysDepartment/GetDepartmentUserList', params);
}

//新增部门
export const insert = function (sysDepartment: SysDepartment) {
   return Http.post('/api/SysDepartment/Insert', sysDepartment)
}

//编辑部门
export const update = function (sysDepartment: SysDepartment) {
   return Http.post('/api/SysDepartment/Update', sysDepartment)
}

//删除部门
export const deleteById = function (params?: { id?: string }) {
   return Http.delete('/api/SysDepartment/Delete', params)
}